var vod_big_class = '-0-0-0-0-0-0-0-0-0-'
var last_page
var itmes = []
module.exports = {
  type: 'list',
  title: '香蕉->类型选择',
  actions: [
    {
      title: '偷拍自拍',
      onClick: async function () {
        vod_big_class = '-4-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '制服诱惑',
      onClick: async function () {
        vod_big_class = '-5-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '清纯少女',
      onClick: async function () {
        vod_big_class = '-6-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '辣妹大奶',
      onClick: async function () {
        vod_big_class = '-7-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '女同专属',
      onClick: async function () {
        vod_big_class = '-8-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '素色出演',
      onClick: async function () {
        vod_big_class = '-9-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '角色扮演',
      onClick: async function () {
        vod_big_class = '-10-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '成人动漫',
      onClick: async function () {
        vod_big_class = '-11-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '人妻熟女',
      onClick: async function () {
        vod_big_class = '-12-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '变态另类',
      onClick: async function () {
        vod_big_class = '-13-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    },
    {
      title: '经典伦理',
      onClick: async function () {
        vod_big_class = '-14-0-0-0-0-0-0-0-0-'
        itmes = []
        this.refresh()
      }
    }
  ],
  searchRoute: $route('list'),
  async fetch({ args, page }) {
    var resp
    //console.log(page)
    if (page == null) {
      resp = await $http.get(
        'https://t7h20r2wsq43r8fl'+Math.ceil(Math.random() * 1000) +'.xjspapps.com/vod/listing'+vod_big_class+'1'
      )
      //last_page = resp.data.rescont.last_page
      //console.log(resp.data.data.vodrows)
    } else {
      
      resp = await $http.get(
          `https://t7h20r2wsq43r8fl`+Math.ceil(Math.random() * 1000) +`.xjspapps.com/vod/listing`+vod_big_class+`${page || 1}`
        )
        itmes = []
        //console.log(typeof last_page + last_page +"xiangmu2")
    }
    if (resp != null) {
      console.log(page)
      for (let i in resp.data.data.vodrows) {
        var tempit = resp.data.data.vodrows[i]
        if (tempit.isvip != '1') {
          //console.log(tempit)
          itmes.push({
            style: 'live',
            title: tempit.title,
            image: tempit.coverpic,
            route: $route('xj/detail', {
              id: tempit.play_url,
              title:tempit.title,
              type: 'hg'
            })
          })
        }
        //console.log(resp.data.data.vodrows[tempitme])
      }
      return {
        nextPage: (page || 1) + 1,
        items: itmes
      }
    }
  }
}
